<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.2 & 7.3
 * @ Decoder version: 1.1.6
 * @ Release: 10/08/2022
 */

// Decoded file for php version 71.
namespace app\agent\model;

class Cardauth2AuthAppModel extends \app\BaseModel
{
    protected $name = "longbing_cardauth2_auth_app";
    public static function getUseNum($app_name, $is_weiqin)
    {
        if($is_weiqin) {
            $app_model_name = APP_MODEL_NAME;
            $count = Cardauth2AuthAppModel::alias("a")->field(["a.id", "a.modular_id", "a. create_time", "a.sign", "c.mini_app_name"])->join("longbing_card_config c", "a.modular_id = c.uniacid")->join("account", "a.modular_id = account.uniacid")->join("wxapp_versions v", "a.modular_id = v.uniacid")->where([["a.status", "=", 1], ["app_name", "like", "%" . $app_name . "%"], ["account.type", "=", 4], ["account.isdeleted", "=", 0], ["v.modules", "like", "%" . $app_model_name . "%"]])->group("a.id")->sum("count");
        } else {
            $count = Cardauth2AuthAppModel::alias("a")->field(["a.id", "a.modular_id", "a. create_time", "a.sign", "c.mini_app_name"])->join("longbing_card_config c", "a.modular_id = c.uniacid")->where([["a.status", "=", 1], ["app_name", "=", $app_name]])->group("a.id")->sum("count");
        }
        return $count;
    }
}

?>